<template>
    <div :class="{ 'dong': flag }" class="love_big">
        <div class="da">
            <div class="shang"></div>
            <div class="xia"></div>
        </div>
    </div>
</template>
<script setup>
let props = defineProps(
    {
        flag: {
            type: Boolean,
            default: () => false
        }
    }
)
</script>
<style scoped lang="scss">
@function r($v) {
    @return $v / (390 /10rem)
}

.dong {
    animation: shadow 1.2s;
}

@keyframes shadow {
    0% {
        z-index: 1;
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -50%)scale(1);
        z-index: 1;
    }

    80% {
        opacity: 0;
        transform: translate(-50%, -50%)scale(0);
        z-index: 1;
    }

    100% {
        z-index: -1;
    }
}

.love_big {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: -1;
    opacity: 0;
    transform: translate(-50%, -50%)scale(0);
}

.da {
    width: r(50);
    height: r(50);
    background-color: red;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.shang {
    border-radius: 50%;
    width: r(50);
    height: r(50);
    position: absolute;
    left: 0;
    top: 0;
    transform: translateX(-50%);
    background-color: red;
}

.xia {
    border-radius: 50%;
    width: r(50);
    height: r(50);
    position: absolute;
    right: 0;
    top: 0;
    transform: translateY(-50%);
    background-color: red;
}
</style>